<link rel="shortcut icon" href="favicon.ico">
<link href="__CSS__/bootstrap.min.css" rel="stylesheet">
<link href="__CSS__/font-awesome.min.css" rel="stylesheet">
<link href="__CSS__/animate.min.css" rel="stylesheet">
<link href="__CSS__/style.min.css" rel="stylesheet">
<link href="__CSS__/admin.css" rel="stylesheet">
<div class="row">
		<div class="ibox float-e-margins">
			<div class="ibox-content">
				<form id="myForm" class="form-horizontal m-t" method="post" action="{:url('add')}">
					<!--基本信息-->
					<div class="panel panel-default">
					<div class="panel-heading"> 基本信息</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">手机号：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="mobile" name="mobile"  value="" class="form-control" />
							</div>
						</div>
						<div class="panel-body">
						<div class="form-group">
							<label class="col-sm-3 control-label">卡号：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="member_no" name="member_no" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">等级：</label>
							<div class="input-group col-sm-9">
								<div class="row">
	                                <div class="col-md-4">
	                                    <select class="form-control" name="member_gradeid" id="member_gradeid">
											<option value="0">会员默认等级</option>
											{volist name="member_level" id="vo"}
												<option value="{$vo.level}">{$vo.levelname}	
												</option>
											{/volist}		
										</select>
	                                </div>
		                        </div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">姓名：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="membername" name="membername" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">性别：</label>
							<div class="input-group col-sm-3">
							<input type="radio" name="sex" value="1" /> 男
							&nbsp;
							<input type="radio" name="sex" value="2" /> 女
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">出生年：</label>
							<div class="input-group col-sm-4">
								<input id='birthday_year' name='birthday_year' value="" onclick="WdatePicker({dateFmt:'yyyy',minDate: '1960',isShowClear:false,readOnly:true})"  type='text' placeholder="" class="form-control layer-date" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">生日：</label>
							<div class="input-group col-sm-4">
								<input id='birthday_monthday' name='birthday_monthday' value="" onclick="WdatePicker({dateFmt:'MM-dd',readOnly:true})"  type='text' placeholder="" class="form-control layer-date" />
								填写月和日，即可收到生日短信（需要管理员开启短信通知）
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">初始积分：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="newbonusflg" name="newbonusflg" readonly=""  value="0" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">初始余额：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="newblanceflg" name="newblanceflg" readonly="" value="0" class="form-control" />
							</div>
						</div>
						
						<div class="form-group">
							<label class="col-sm-3 control-label">密码：</label>
							<div class="input-group col-sm-4">
								<input type="password" id="password" name="password" placeholder="6位数字" class="form-control" />
							</div>
						</div>
					</div>
					</div>
					<!--基本信息end-->
					
					<!--扩展信息-->
					<div class="panel panel-default">
					<div class="panel-heading"> 扩展信息</div>
						<div class="panel-body">
						<div class="form-group">
							<label class="col-sm-3 control-label">证件号：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="identity_no" name="identity_no" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">电子邮箱：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="email" name="email" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">固定电话：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="tel" name="tel" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">QQ号：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="qqnumlk" name="qqnumlk"  value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">微信号：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="wxcode" name="wxcode"  value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">所在地区：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="member_addarea" name="member_addarea"  value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">详细地址：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="address" name="address"  value="" placeholder="街道" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">工作单位：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="company" name="company"  value="" placeholder="公司名称" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">推荐人：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="recommender_noeq" name="recommender_noeq"  value="" placeholder="请输入推荐人卡号" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">押金：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="card_deposit" name="card_deposit"  value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">备注：</label>
							<div class="input-group col-sm-4">
								<textarea id="remarks" name="remarks" rows="5" style="width: 450px;" placeholder="备注"></textarea>
							</div>
						</div>
						</div>
					</div>
					<!--扩展信息end-->
					
					<!--自定义属性-->
					<div class="panel panel-default">
					<div class="panel-heading"> 自定义属性</div>
						<div class="panel-body">
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv1}{$attr.custom_propertyv1}{else}自定义属性1{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property1" name="custom_property1" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv2}{$attr.custom_propertyv2}{else}自定义属性2{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property2" name="custom_property2" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv3}{$attr.custom_propertyv3}{else}自定义属性3{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property3" name="custom_property3" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv4}{$attr.custom_propertyv4}{else}自定义属性4{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property4" name="custom_property4" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv5}{$attr.custom_propertyv5}{else}自定义属性5{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property5" name="custom_property5" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv6}{$attr.custom_propertyv6}{else}自定义属性6{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property6" name="custom_property6" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv7}{$attr.custom_propertyv7}{else}自定义属性7{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property7" name="custom_property7" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv8}{$attr.custom_propertyv8}{else}自定义属性8{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property8" name="custom_property8" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv9}{$attr.custom_propertyv9}{else}自定义属性9{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property9" name="custom_property9" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv10}{$attr.custom_propertyv10}{else}自定义属性10{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property10" name="custom_property10" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv11}{$attr.custom_propertyv11}{else}自定义属性11{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property11" name="custom_property11" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv12}{$attr.custom_propertyv12}{else}自定义属性12{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property12" name="custom_property12" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv13}{$attr.custom_propertyv13}{else}自定义属性13{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property13" name="custom_property13" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv14}{$attr.custom_propertyv14}{else}自定义属性14{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property14" name="custom_property14" value="" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">{if $attr.custom_propertyv15}{$attr.custom_propertyv15}{else}自定义属性15{/if}：</label>
							<div class="input-group col-sm-4">
								<input type="text" id="custom_property15" name="custom_property15" value="" class="form-control" />
							</div>
						</div>						
						</div>
					</div>
					<!--自定义属性end-->
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<div class="col-sm-4 col-sm-offset-3">
							<button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> 保存</button>&nbsp;&nbsp;
						</div>
					</div>
				</form>
			</div>
		</div>
</div>
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/bootstrap.min.js"></script>
<script src="__JS__/jquery.metisMenu.js"></script>
<script src="__JS__/jquery.slimscroll.min.js"></script>
<script src="__LIB__/layer/layer.js"></script>
<script src="__JS__/core.min.js"></script>
<script src="__JS__/pace.min.js"></script>
<script src="__JS__/jquery.form.js"></script>
<script src="__LIB__/datepicker/WdatePicker.js"></script>
<script src="__LIB__/validate/jquery.validate.min.js"></script>
<script src="__LIB__/validate/messages_zh.min.js"></script>
<script src="__LIB__/validate/add_validate.min.js"></script>
<script src="__LIB__/fileinput/js/fileinput.min.js"></script>
<script src="__LIB__/fileinput/js/locales/zh.js"></script>
<script src="__LIB__/ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="__LIB__/ueditor/ueditor.all.js" type="text/javascript"></script>
<script>
//编辑器
	$(function() {
		function confimgS(){
			var s=$("input:radio[name='pros']:checked").val();
			var p=window.parent.document.getElementById('product_name');
			var p1=window.parent.document.getElementById('product_id');
			if(s==null){
				return;
			}
			p.value=$("#pros"+s).val();
			p1.value=s;
			window.parent.call_back();
		}
		$("#myForm").validate({
			rules: {
				memberNo: "required",
				membername:"required"
			},
			messages: {
				memberNo:  "请输入会员卡号",
				membername: "请输入姓名"
			},
			submitHandler: function(form) {
				var data=$("#myForm").serialize();
				$.ajax({
					url:'add_member',
					data:data,
					type:"post",
					success: function(data) {
						window.parent.call_back(data.msg);
					}
				})
			}
		});
	});
</script>
<script>
	function jiancha(){
		var value = document.getElementById("validit").checked;
		if(value == true){
			$("input[name='validity_date']").val('');
			$("input[name='validity_date']").attr('disabled',true);
		}else if(value == false){
			$("input[name='validity_date']").attr('disabled',false);
		}
	}
</script>
